﻿<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/8/30 0030
  Time: 22:57
  To change this template use File | Settings | File Templates.
  用户出售时间
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../inc/top.jsp"%>
<div class="container">
    <h1 class="page-header col-lg-offset-0">出售时间</h1>
    <form class="form col-lg-5" action="<%=ctxpath%>/user/chushoutime" method="post" name="frmChushou" id="frmChushou" >
        <div class="form-group">
            <label>名称</label>
            <input class="form-control" id="mingchneg" name="mingchneg" />
        </div>
        <div class="form-group">
            <label>我会什么</label>
            <input class="form-control" id="jineng" name="jineng" />
        </div>
        <div class="form-group">
            <label>我希望的酬劳</label>
            <input class="form-control" id="choulao" name="choulao" />
        </div>
        <div class="form-group">
            <label>有效时间</label>
            <input class="form-control sr-only-focusable" value="开始时间" id="kaishishijian" name="kaishishijian" onFocus="WdatePicker({lang:'zh-cn'})"/></br>

            <input class="form-control sr-only-focusable" value="截止日期"id="jieshushijian" name="jieshushijian" onFocus="WdatePicker({lang:'zh-cn'})" />
        </div>
        <div class="form-group">
            <label>活动区域</label>
            <input class="form-control" name="huodongquyu" />
        </div>
        <div class="form-group">
            <label>备注</label>
            <textarea class="form-control" rows="3" name="beizhu" id="beizhu"></textarea>
        </div>
        <div  >
            <label>
                <h4>是否允许竞标：</h4>
                <input id="ch1" type=radio name="shifoujingbiao" value="是">
                允许
                <input id="ch2"  type=radio name="shifoujingbiao"  value="否" checked>
                不允许<p>
            </label>
        </div>

        <div id="hidd" style="display:none ">
            <div >
                <label  >
                    <h4> 酬劳下限</h4>
                    <input type="text" class="form-control" name="choulaoxiaxian" id="choulaoxiaxian"  />
                </label>
            </div >
            <div >
                <label>
                <h4>竞标期限</h4>
                <input id="jingbiaoqixian" name="jingbiaoqixian" size="26"  type="text" value="" class="Wdate" onFocus="WdatePicker({lang:'zh-cn'})">
                </label>
            </div>
        </div>
        </br>

        <div class="form-group">
            <button class="btn btn-primary" type="button" name="fabu" id="fabu">发布</button>
            <a href="<%=ctxpath%>/user/zhujiemiangg.jsp"> <button class="btn btn-primary" type="button" name="chexiao" id="chexiao">撤销</button></a>
        </div>



    </form>

</div>
<script>
    $(function () {
        $("#fabu").click(function(){
            var xiaxian = $("#choulaoxiaxian").val() ;
            if($("#choulao").val()==""||$("#jineng").val()==""||$("#kaishishijian").val()==""||$("#jieshushijian").val()==""){
                alert("信息填写不完全");
                return ;
            }
            else if(document.getElementById("ch1").checked &&( $("#choulaoxiaxian").val()==""||$("#jingbiaoqixian").val()=="") )
            { alert("竞标信息填写不完整");return ;}
            else if($("#jingbiaoqixian").val()>$("#jieshushijian").val()){alert("竞标日期晚于结束日期");return;}
            else  if($("#jingbiaoqixian").val()!=""&&$("#choulaoxiaxian")<=0){
                alert("酬劳下限必须大于0");
                return ;
            }
            else {
                alert("您的时间出售发布成功待审核通过");
                $("#frmChushou").submit() ;
            }
        });
    });
</script>
<%@ include file="../inc/bottom.jsp"%>